import Vue from 'vue'
import Router from 'vue-router'
import hooks from './hooks';
import loginRouter from './login';
import homeRouter from './home';
import confRouter from './conf';
Vue.use(Router);

const router = new Router({
    mode: 'hash',
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition;
        }

        return {
            x: 0,
            y: 0
        };
    },
    routes: [
        ...loginRouter,
        ...homeRouter,
        ...confRouter,
    ]
});

// 添加导航钩子
hooks(router);

export default router;
